/* 首页数据接口 */

import request from '@/utils/request'
/**
 * 首页缺陷数量
 */
export function getDefectInfo(query) {
  return request({
    url: '/repair/jcwDefectInfoRead/countJcwDefectInfoByGradeCode',
    method: 'get',
    params: query
  })
}
/**
 * 4.	统计管辖总里程
 */
export function getRepairOperateKilAll(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairOperateKilAll',
    method: 'get',
    params: query
  })
}
/**
 * 本月本年度已检修里程数
 */
export function getRepairAmounAll(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairAmountAll',
    method: 'get',
    params: query
  })
}
/**
* 每条线路本年度已检修里程数
* @param {string} dateFlag ("year"\"month" 分别代表年度\月度)
*/
export function getRepairAmounByLine(query) {
  return request({
    url: '/repair/jcwRepairJob/getRepairAmountByLineCode',
    method: 'get',
    params: query
  })
}
/**
 * 每车间本年度已检修和总管辖里程数
 * @param {string} dateFlag ("year"\"month" 分别代表年度\月度)
 * @return operateKm 每车间管辖总里程数, repairAmount 每车间本年度或本月已检修里程数
 */
export function getRepairAmounByPath(query) {
  return request({
    url: '/repair/jcwRepairJob/getWorkshopMileageByIdPath',
    method: 'get',
    params: query
  })
}
/**
 * 首页检修告警数量 - 维修
 */
export function getPillarAlarmCount(query) {
  return request({
    url: '/basic/pillar/countPillarAlarm',
    method: 'get',
    params: query
  })
}
export function getDeviceAlarmCount(query) {
  return request({
    url: '/basic/jcwDevice/countBaseDeviceAlarm',
    method: 'get',
    params: query
  })
}
/* 从缓存中获取 */
export function getDeviceAlarmCountByMemery(query) {
  return request({
    url: '/basic/jcwDevice/countBaseDeviceAlarmByMemory',
    method: 'get',
    params: query
  })
}
/**
* 线路下区间站场维修情况
*/
export function getAlarmCountBySite(query) {
  return request({
    url: '/basic/jcwRepairJob/getRepairAmountBySite',
    method: 'get',
    params: query
  })
}
/**
 * 首页检测告警
 */
export function getDetectAlarm(query) {
  return request({
    url: '/repair/detectAlarm/findDetectAlarm',
    method: 'get',
    params: query
  })
}
/**
 * CQI
 */
export function getDetectCQI(query) {
  return request({
    url: '/repair/detectCQI/findDetectCQI',
    method: 'get',
    params: query
  })
}
/**
 * 重点工作详情
 */
export function keyWorkDetail(query) {
  return request({
    url: `/sysm/cms/keyWork/${query}`,
    method: 'get'
  })
}
